Remote one dialog box from another

I am faced with the requirement where if one applies the button "Export" from one DB then it should call a callback function which contains code to remotely apply the button of a script that is "#included" in this callback function. Elsewhere in this forum I found topics that contain info on remote button apply by overriding "Show" and "block" function. But in my case these are under a 'Callback" function and I get the error saying "non-local variable access" for the variables defined in the included script. The same code which is in my callback function if executed directly from DXL interaction window then it is executing without errors.

 

My callback function looks like this:

void callEnhExcel(string m1, string v1)  // m1 and v1 are read from a skip list which contain name of module and view
{

   
    //release TheMainDB  //This is actually the main dialog box containing many list elements and allows to select modules and views from multiple folders and do export
    //setParent(TheMainDB,tmpDB)
    print "The value of m1 is :" m1 "\n"
    Module mExport = read(m1,true)
    
    print "The current module is :" name(mExport) "\n"
    load view v1
    print m1 "\n"
    void warningBox (string s) {print "Warning: " s "\n" }
    bool confirm (string s) { print "Confirmed: " s "\n"; return true }
    void ack (string s) {print "Acknowledge: " s "\n" }
    void acknowledge (string s) {print "Acknowledge: " s "\n"  }
    void infoBox (string s) {print "Info: " s "\n" }
    void info (string s) {print "Info: " s "\n" }
    
    
    tmpDB = null
    // Now override block and show, to only do realize
    void show  (DB x) { realize x; tmpDB = x }
    void block (DB x) { realize x; tmpDB = x }
    
    // while(true)
    {
        //setDXLWindowAsParent(tmpDB)
         #include "C:/Users/inakiran/Documents/sodiusWS2/Enhanced Export to Excel.dxl"
        // exportPreChecks( current Module )
        //    makeExcelExportUI( current Module )
            exportModuleToExcel excelExportDB    
           if (!null tmpDB)
                destroy tmpDB
    }
        //destroy tmpDB
        
}


CAUK77 - Wed May 18 06:26:49 EDT 2016

Re: Remote one dialog box from another
DOORSHAM - Wed May 18 06:44:27 EDT 2016

My first approach would be move the #include up to the very top; that is assuming you have modified Enhanced Export to Excel.dxl to not pop up a gui on its own.

Re: Remote one dialog box from another
Costas..Aravidis - Thu May 19 02:10:43 EDT 2016

Why do you override standard functions, especially when you do not give them extra functionality?

 

What do you mean by remote? Remote normally means that you are in one machine and then you do something in the other machine.

 

From what I'm guessing you try to export a lot of different modules and views to excel spreadsheets. In that case it would be much easier to create an excel exporter by using ole automation than using the "Enhanced Export to Excel.dxl". You will need to modify that script to work automatically where with your own excel export you can do it much more easier.